<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./local.js"></script>
</head>
<body>
    <button class="b1">获取本地存储数据</button>
    <button class="b2">移除本地存储user</button>
    <button class="b3">清除所有本地存储数据</button>
    <script>
        local.set('user1',{name:'张三',age:40});
        local.set('user2',{name:'王五',age:30});
        document.querySelector('.b1').onclick=()=>console.log(local.get('user1'));
        document.querySelector('.b2').onclick=()=>local.remove('user1');
        document.querySelector('.b3').onclick=()=>local.clear();
    </script>
</body>
</html>